package javapoet.syntax.com.plib;

import android.app.Activity;
import android.util.Log;

import java.lang.reflect.Constructor;

public class Injector {

    public static void inject(Object a) {
        String claxxName = a.getClass().getName();
        String targetClassName = claxxName + "_Bind";

        try {
            Class claxx = Class.forName(targetClassName);
            Log.i("annot", "annot class : " + claxx);

            Constructor constructor = claxx.getDeclaredConstructor(a.getClass());
            assert constructor != null;
            constructor.setAccessible(true);
            Object instance = constructor.newInstance(a);
            Log.i("annot", "on, get instance " + instance);
        } catch (ClassNotFoundException e) {
            e.printStackTrace();
        } catch (Exception e) {

        }

    }


}
